package com.sxj.corejava.code09_集合.map;

import java.util.Enumeration;
import java.util.Properties;

/**
 * @author 石小俊
 * @date 2025年02月20日
 */
public class Test07_获取系统属性 {

    public static void main(String[] args) {
        // 获取所有系统配置
        Properties properties = System.getProperties();
        System.out.println(properties);
        Enumeration<Object> keys = properties.keys();
        while (keys.hasMoreElements()) {
            String key = (String) keys.nextElement();
            String value = properties.getProperty(key);
            System.out.println(key + "=" + value);
        }
        System.out.println("***********************");
        System.out.println("JavaHome:" + properties.getProperty("java.home"));
        System.out.println("字符集:" + properties.getProperty("file.encoding"));
        System.out.println("JDK版本:" + properties.getProperty("java.version"));
    }

}
